/*
 * calculate.c
 *
 *  Created on: 2018年11月10日
 *      Author: Reality
 */
#include <stdio.h>
#include <stdlib.h>
#include "calculate.h"

Calculate* C_Calculate ()
{
  Calculate* cp = (Calculate*)malloc(sizeof(Calculate));
  cp->i = 10;
  cp->j = "hello world";
  cp->cal = NULL;

  Calculate* cp1 = (Calculate*)malloc(sizeof(Calculate));
  cp1->i = 11;
  cp1->j = "hello world";
  cp1->cal = NULL;

  //  Calculate cp1 = {
  //      .i = 11,
  //      .j = "hello world",
  //      .cal = NULL,
  //      .pcal = NULL
  //  };
  //
  //  Calculate cp = {
  //      .i = 10,
  //      .j = "hello world",
  //      .pcal = NULL
  //  };


  Calculate* cal = (Calculate*)malloc(sizeof(Calculate));
  cal->j = "123456";
  cal->cal = cp;
  cal->pcal = cp1;
  //  Calculate cal = {
  //      .i = 10,
  //      .j = "123456",
  //      .cal = cp
  //  };

  return cal;
}
